package function;

public class 判断一个数在数组中是否存在 {
    public static void main(String[] args) {
        int[] arr = { 1, 5, 23, 4, 10 };
        System.out.println(iscontains(arr, 0));
    }

    public static boolean iscontains(int[] arr, int number) {
        for (int i = 0; i < arr.length; i++) {
            if (number == arr[i]) {
                return true;
            }
        }
        return false;
    }
}
